Skip to content

CLI: show task outputs (branch, PR, cost) when --watch completes#381

Closed
axon-agent[bot] wants to merge 1 commit intomainfrom
axon-fake-user-20260218-0900
Closed

CLI: show task outputs (branch, PR, cost) when --watch completes#381
axon-agent[bot] wants to merge 1 commit intomainfrom
axon-fake-user-20260218-0900

Conversation

@axon-agent
Copy link

@axon-agent axon-agent bot commented Feb 18, 2026

Problem

When using axon run -w (watch mode), the current output is:

task/task-a5b3c Running
task/task-a5b3c Succeeded

No indication of what the agent actually produced — the PR URL, branch name, commit SHA, or token cost are silently discarded. New users have to separately discover and run axon get task <name> to see results, which is not obvious.

The -w flag is highlighted in the Quick Start (axon run -p "..." -w) so this is the primary UX path for new users.

Fix

After the task reaches a terminal phase (Succeeded or Failed), watchTask now prints the populated result fields inline:

task/task-a5b3c Running
task/task-a5b3c Succeeded
  branch:              axon-task-a5b3c
  pr:                  https://github.com/org/repo/pull/42
  commit:              abc1234def
  cost-usd:            1.23
  input-tokens:        5432
  output-tokens:       1201

Only fields with non-empty values are shown. Tasks with no results (e.g. simple one-off prompts with no workspace) print nothing extra — no change in behaviour for those cases.

Test plan

  • Added unit tests for printTaskResults covering: PR+branch+commit, cost+tokens, empty results, empty individual values
  • make test passes
  • make verify passes

🤖 Generated with Claude Code


Summary by cubic

Shows task outputs (branch, PR, commit, cost, tokens) when axon run -w completes, so users see results immediately without running axon get task.

  • New Features
    • watchTask now prints key results after a task reaches Succeeded or Failed.
    • Supports: branch, pr, commit, cost-usd, input-tokens, output-tokens.
    • Only non-empty fields are shown; tasks without results print nothing extra.
    • Added unit tests for printTaskResults.

Written for commit da65458. Summary will update on new commits.

When using `axon run -w`, the watchTask function previously only printed
phase transitions (e.g. "task/xyz Succeeded") with no indication of what
the agent actually produced. New users would need to know to separately run
`axon get task <name>` to discover the PR URL, branch name, commit SHA, or
token usage.

This change makes watchTask print key results (branch, pr, commit,
cost-usd, input-tokens, output-tokens) immediately after the task reaches
a terminal phase, so the most useful outputs appear right in the terminal
where the user is waiting.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copy link

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 2 files

@gjkim42 gjkim42 closed this Feb 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant